home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Just Call Me Internet
/
Just Call Me Internet.iso
/
archives
/
com
/
internet
/
stik
/
gls002b5.zoo
/
global.h
< prev
next >
Wrap
C/C++ Source or Header
|
1997-09-21
|
4KB
|
127 lines
#ifndef GLOBAL_H
#define GLOBAL_H
#ifndef COMPILER_H
#include <compiler.h>
#endif
#include <osbind.h>
#include <mintbind.h>
#include "drivers.h"
#include "transprt.h"
#ifdef DEBUG
#define GS_TRACE "GLUESTIK_TRACE"
#endif
/* IDs for the semaphores and mailboxes we'll need */
#define DMN_MBOX 0x43544D44L /* 'GSMD' */
#define DEBUG_SEM 0x43545444L /* 'GSSD' */
#define ARENA_SEM 0x43545441L /* 'GSSA' */
#ifdef MULTITHREAD
#define FD_SEM 0x43545446L /* 'GSSF' */
#endif
#define CIB_SEM 0x43545443L /* 'GSSC' */
#define CONFIG_SEM 0x43545456L /* 'GSSV' */
/* I can never remember which one of these is which... */
#define Psem_create(sem) Psemaphore(0, (sem), 0)
#define Psem_destroy(sem) Psemaphore(1, (sem), 0)
#define Psem_obtain(sem) Psemaphore(2, (sem), -1)
#define Psem_release(sem) Psemaphore(3, (sem), 0)
/* Similarly.. */
#define Pmsg_recv(mboxid, msgptr) Pmsg(0, (mboxid), (msgptr))
#define Pmsg_send(mboxid, msgptr) Pmsg(1, (mboxid), (msgptr))
#define Pmsg_send_certified(mboxid, msgptr) Pmsg(2, (mboxid), (msgptr))
/* struct for Pmsg() */
typedef struct {
long userlong1;
long userlong2;
short pid;
} PMSG;
extern DRV_HDR* __CDECL do_get_dftab __PROTO((char *));
extern int16 __CDECL do_ETM_exec __PROTO((char *));
extern void main_loop __PROTO((void));
/* Inelegant Hack(TM): The daemon versions of these routines all get an
extra parameter containing the caller pid (can't use a global variable,
in case multithreading is enabled). */
#ifdef DAEMON
#define CALLER_PID int,
#else
#define CALLER_PID
#endif
extern char* __CDECL do_KRmalloc __PROTO((CALLER_PID int32));
extern void __CDECL do_KRfree __PROTO((CALLER_PID void *));
extern int32 __CDECL do_KRgetfree __PROTO((CALLER_PID int16));
extern char* __CDECL do_KRrealloc __PROTO((CALLER_PID char *, int32));
extern char* __CDECL do_get_err_text __PROTO((int16));
extern char* __CDECL do_getvstr __PROTO((CALLER_PID char *));
extern int16 __CDECL do_carrier_detect __PROTO((void));
extern int16 __CDECL do_TCP_open __PROTO((CALLER_PID uint32, int16, int16,
uint16));
extern int16 __CDECL do_TCP_close __PROTO((CALLER_PID int16, int16));
extern int16 __CDECL do_TCP_send __PROTO((CALLER_PID int16, char* , int16));
extern int16 __CDECL do_TCP_wait_state __PROTO((CALLER_PID int16, int16,
int16));
extern int16 __CDECL do_TCP_ack_wait __PROTO((int16, int16));
extern int16 __CDECL do_UDP_open __PROTO((CALLER_PID uint32, int16));
extern int16 __CDECL do_UDP_close __PROTO((CALLER_PID int16));
extern int16 __CDECL do_UDP_send __PROTO((CALLER_PID int16, char *, int16));
extern int16 __CDECL do_CNkick __PROTO((int16));
extern int16 __CDECL do_CNbyte_count __PROTO((CALLER_PID int16));
extern int16 __CDECL do_CNget_char __PROTO((CALLER_PID int16));
extern NDB* __CDECL do_CNget_NDB __PROTO((CALLER_PID int16));
extern int16 __CDECL do_CNget_block __PROTO((CALLER_PID int16, char *,
int16));
extern void __CDECL do_housekeep __PROTO((CALLER_PID void));
extern int16 __CDECL do_resolve __PROTO((CALLER_PID char *, char **, uint32 *,
int16));
extern void __CDECL do_ser_disable __PROTO((void));
extern void __CDECL do_ser_enable __PROTO((void));
extern int16 __CDECL do_set_flag __PROTO((int16));
extern void __CDECL do_clear_flag __PROTO((int16));
extern CIB* __CDECL do_CNgetinfo __PROTO((CALLER_PID int16));
extern int16 __CDECL do_on_port __PROTO((char *));
extern void __CDECL do_off_port __PROTO((char *));
extern int16 __CDECL do_setvstr __PROTO((CALLER_PID char *, char *));
extern int16 __CDECL do_query_port __PROTO((char *));
extern int16 __CDECL do_dummy __PROTO((int));
extern int init_mem __PROTO((void));
extern int init_net __PROTO((void));
extern int init_stubs __PROTO((void));
extern int load_config_file __PROTO((void));
extern void cleanup_net __PROTO((void));
extern void cleanup_config __PROTO((void));
extern void cleanup_mem __PROTO((void));
#ifdef DEBUG
extern int init_debug __PROTO((void));
extern void cleanup_debug __PROTO((void));
#endif
#ifdef DEBUG
#define DBG_NOMSG 0
#define DBG_FATAL 1
#define DBG_ERROR 2
#define DBG_SYSCALL 3
#define DBG_TRACE 4
extern void log_entry(int, int, const char *, ...);
extern int debug_level;
#define LOG (!debug_level)?((void)0):log_entry
#endif
extern CONFIG driver_config;
extern DRV_LIST driver;
extern TPL trampoline;
#endif /* GLOBAL_H */